
#include <windows.h>
#include <stdio.h>

DWORD WINAPI ThreadFunc(LPVOID lpParam) {
	for (int i = 0; i < 10; i++) {
		printf("%d%d%d%d%d%d%d%d\n", 
			lpParam, lpParam, lpParam, lpParam, 
			lpParam, lpParam, lpParam, lpParam);
	}
	return 0;
}

int main() {

	HANDLE hThrd;
	DWORD threadId;
	for (int i = 0; i < 5; i++) {
		hThrd = CreateThread(NULL, 0, ThreadFunc, (LPVOID)i, 0, &threadId);
		if (hThrd) {
			printf("Thread launched %d\n", i);
			CloseHandle(hThrd);
		}
	}
	// Wait for the threads to complete
	Sleep(2000);
	return EXIT_SUCCESS;
}
